﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace BBInterfaceNET
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public App()
        {
            this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);   
        }

        void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            string str = string.Format("An unexpected error occured.\nError: {0}\nStack Trace:\n{0}\nThe application will terminate.", e.Exception.Message, e.Exception.StackTrace);
            MessageBox.Show("An unexpected error occured: "+e.Exception.Message);
        }
        
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            Bootstrapper b = new Bootstrapper();
            b.Run();
        }
        
    }
}
